package com.codeest.geeknews.ui.main.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;

import com.codeest.geeknews.R;
import com.codeest.geeknews.base.SimpleActivity;
import com.codeest.geeknews.ui.main.fragment.LasfmMusicFragment;


public class MusicActivity extends SimpleActivity implements LasfmMusicFragment.MusicInteraction {
    public static boolean isMusicActivityTop = false;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    protected void onResume() {
        super.onResume();
        isMusicActivityTop = true;
    }

    @Override
    protected int getLayout() {
        return R.layout.activity_music;
    }

    @Override
    protected void initEventAndData() {

    }

    @Override
    public void toggleMenu() {

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        isMusicActivityTop = false;
    }

    /**
     * 设置 单个Activity后台运行，及Activity隐藏但是不调用OnDestory方法
     * 1、moveTaskToBack(true);
     * 2、android:launchMode="singleInstance"
     */
    @Override
    public void onBackPressedSupport() {
        //super.onBackPressedSupport();
        isMusicActivityTop = false;
        moveTaskToBack(true);
        overridePendingTransition(R.anim.slide_left_in, R.anim.slide_right_out);
//        overridePendingTransition(R.anim.slide_top_in, R.anim.slide_bottom_out);
    }
}
